//
//  HomeViewController.swift
//  Weibo-Swift
//
//  Created by LYFDevelopment on 2017/4/11.
//  Copyright © 2017年 LYFDevelopment. All rights reserved.
//

import UIKit

private let cellID = "cellID"
class HomeViewController: BaseViewController {
    
    //微博假数据
    lazy var statusList = [String]()
    
    override func loadData() {
        for i in 0..<10 {
            statusList.insert(i.description, at: 0)
        }
    }
   
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    func showFriend() -> Void {
        
    }
}

//表格数据源方法
extension HomeViewController{
    override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return statusList.count
    }
    override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: cellID
            , for: indexPath)
        cell.textLabel?.text = statusList[indexPath.row]
        
        return cell 
    }
}
//设置界面
extension HomeViewController{

    override func setUpUI() {
        super.setUpUI()
        //设置导航栏按钮
        navItem.leftBarButtonItem = UIBarButtonItem.init(title: "好友", target: self, action: #selector(showFriend))
        tableView?.register(UITableViewCell.classForCoder(), forCellReuseIdentifier: cellID)
    }

}
